#import <UIKit/UIKit.h>

#import "framework/FWDBAccess.h"


@class SBApplication;
@class FWApplication;

enum PIActionType {
    PIActionNone = 0,
    PIActionNext = 1,
    PIActionActive = 2,
    PIActionPlanning = 3,
    PIActionDelegated = 4,
    PIActionWaiting = 5,
    PIActionHold = 6,
    PIActionPostponed = 7,
    PIActionSomeday = 8,
    PIActionCancelled = 9,
    PIActionReference = 10
};

enum PIImportanceType {
    PIImportanceNone = 0,
    PIImportanceTop = 1,
    PIImportanceHigh = 5,
    PIImportanceNormal = 10,
    PIImportanceLow = 15
};

enum DateFormatterFormat {
    DateFormatterLongFormat = 0,
    DateFormatterNormalFormat = 1,
    DateFormatterCompressedFormat = 2
};

extern NSString* const PIIntegrationContextPasteboard;
extern NSString* const PIContextFieldNameTitle; 
extern NSString* const PIContextFieldNameKey; 


@interface PIIntegration : NSObject <FWDBAccessDelegate>


+ (NSDate*)utcDateForLocalMidnight;
+ (NSDate*)localDateForDateNumber:(NSNumber*)dateNum;
+ (NSDate*)localDateForTimeNumber:(NSNumber*)dateNum;

+ (NSString*)dateStringForDateNumber:(NSNumber*)dateNum withTime:(BOOL)time format:(DateFormatterFormat)format;
	
+ (NSString*)iconFileForAction:(int)action;
+ (NSString*)iconPathForAction:(int)action application:(FWApplication*)application;

+ (NSString*)iconPathForSmallFlag:(FWApplication*)application;
+ (NSString*)iconPathForLargeFlag:(FWApplication*)application;

+ (NSString*)iconPathForParent:(FWApplication*)application;
+ (NSString*)iconPathForChild:(FWApplication*)application;

+ (NSString*)iconPathForRepeat:(FWApplication*)application;

+ (NSString*)nameForAction:(int)action;
+ (NSString*)nameForImportance:(int)importance;

+ (UIColor*)colorForAction:(int)action application:(FWApplication*)application;
+ (UIColor*)colorBGForAction:(int)action application:(FWApplication*)application;
+ (UIColor*)colorForImportance:(int)importance application:(FWApplication*)application;
+ (UIColor*)colorBGForImportance:(int)importance application:(FWApplication*)application;
+ (UIColor*)colorForOverdue:(FWApplication*)application;

+ (void)updateColorsFromPrefs:(NSDictionary*)prefs application:(FWApplication*)application;

+ (BOOL)locationMonitoringForPrefs:(NSDictionary*)prefs;

+ (NSArray*)locationContextsFromPI;

+ (NSString*)newTaskURL:(NSString*)title importance:(enum PIImportanceType)importance application:(FWApplication*)app;

@end
